<?php


require 'common.php';

$id = $_GET['id'];
$result = mysql_fetch_assoc(mysql_query("select * from `blogclass` where `id`  = '$id'"));
require 'templates/edit.html';
if($_POST){
    $title = $_POST['title'];
    $content = $_POST['content'];
    $class = $_POST['categoryId'];
    mysql_query("update blogclass set title='$title',content = '$content',class = '$class' where id = '$id'");
    echo "<script>alert('修改成功！');location.href='index.php'</script>";
}
